package com.ydj.framework.utils;

/**
 * 获取缓存key
 */
public class GetBufferKey {

    /**
     * 京东万象拉去阿里商品详情缓存key前缀
     */
    private static final String JDWX_PULL_PRODUCT_DETAILS_BY_ALI = "JDWXGetProDetail_";

    /**
     * 神箭手拉去淘宝商品详情缓存key前缀
     */
    private static final String SJS_GET_PRODUCT_DETAILS_FOR_TB = "SJSGetProDetailForTb_";

    /**
     * 神箭手拉去天猫商品详情缓存key前缀
     */
    private static final String SJS_GET_PRODUCT_DETAILS_FOR_TM = "SJSGetProDetailForTm_";

    /**
     * 神箭手拉去京东商品详情缓存key前缀
     */
    private static final String SJS_GET_PRODUCT_DETAILS_FOR_JD = "SJSGetProDetailForJd_";

    /**
     * 京东万象拉去阿里商品列表缓存key前缀
     */
    private static final String JDWX_PULL_THIRD_SHOP_PRODUCT_BY_ALI = "GetAliShopProList_";

    /**
     * 99api拉1688产品缓存key前缀
     */
    private static final String API_99_ALI_PRODUCT = "Get99AliShopPro_";

    /**
     * 99api拉京东产品缓存key前缀
     */
    private static final String API_99_JD_PRODUCT = "Get99JdShopPro_";

    /**
     * 99api拉1688列表缓存key前缀
     */
    private static final String API_99_ALI_LIST = "Get99AliShopProList_";

    /**
     * 99api拉京东店铺商品列表缓存key前缀
     */
    private static final String API_99_JD_LIST = "Get99JdShopProList_";

    /**
     * 99api拉ppd商品详情缓存key前缀
     */
    private static final String API_99_PDD_PRODUCT_DETAIL = "Get99PddProductDetail_";

    /**
     * 99api拉ppd商品列表缓存key前缀
     */
    private static final String API_99_PDD_PRODUCT_LIST = "Get99PddProductList_";

    /**
     * 99api拉ppd商品详情缓存key前缀
     */
    private static final String API_99_JD_PRODUCT_DETAIL = "Get99JdProductDetail_";

    /**
     * 获取京东万象拉去阿里商品详情缓存key
     *
     * @param thirdProductId 第三方商品ID
     * @return key
     */
    public static String getJDWXPullProductDetailsByAliKey(String thirdProductId) {
        return JDWX_PULL_PRODUCT_DETAILS_BY_ALI + thirdProductId;
    }

    /**
     * 获取神箭手拉去淘宝商品详情缓存key
     *
     * @param thirdProductId 第三方商品ID
     * @return key
     */
    public static String getSJSGetProductDetailsForTbKey(String thirdProductId) {
        return SJS_GET_PRODUCT_DETAILS_FOR_TB + thirdProductId;
    }

    /**
     * 获取神箭手拉去天猫商品详情缓存key
     *
     * @param thirdProductId 第三方商品ID
     * @return key
     */
    public static String getSJSGetProductDetailsForTmKey(String thirdProductId) {
        return SJS_GET_PRODUCT_DETAILS_FOR_TM + thirdProductId;
    }

    /**
     * 获取神箭手拉去京东商品详情缓存key
     *
     * @param thirdProductId 第三方商品ID
     * @return key
     */
    public static String getSJSGetProductDetailsForJdKey(String thirdProductId) {
        return SJS_GET_PRODUCT_DETAILS_FOR_JD + thirdProductId;
    }

    /**
     * 获取京东万象拉去阿里商品列表缓存key
     *
     * @param thirdShopId 第三方店铺ID
     * @param page        页码
     * @return key
     */
    public static String getJDWXPullThirdShopProductByAliKey(String thirdShopId, Integer page) {
        return JDWX_PULL_THIRD_SHOP_PRODUCT_BY_ALI + thirdShopId + "_" + page;
    }

    public static String getApi99AliKey(String thirdProductId) {
        return API_99_ALI_PRODUCT + thirdProductId;
    }

    public static String getApi99JdKey(String thirdProductId) {
        return API_99_JD_PRODUCT + thirdProductId;
    }

    public static String getApi99AliListKey(String url, Integer page) {
        return API_99_ALI_LIST + url + "_" + page;
    }

    /**
     * 通过99API获取京东店铺商品Key
     *
     * @param jdShopId 京东店铺ID
     * @param page     页码
     * @return 可以
     */
    public static String getApi99JdListKey(String jdShopId, Integer page) {
        return API_99_JD_LIST + "_jdShop" + jdShopId + "_page" + page;
    }

    /**
     * 获取99API 拉取PDD详情缓存KEY
     *
     * @param itemId
     * @return
     */
    public static String getApi99PddDetailKey(String itemId) {
        return API_99_PDD_PRODUCT_DETAIL + itemId;
    }

    public static String getApi99PddProductList(String mallId, Integer page) {
        return API_99_PDD_PRODUCT_LIST + "_pddShop" + mallId + "_page" + page;
    }

    /**
     * 获取99API 拉取PDD详情缓存KEY
     *
     * @param itemId
     * @return
     */
    public static String getApi99JdDetailKey(String itemId) {
        return API_99_JD_PRODUCT_DETAIL + itemId;
    }
}
